<?php

namespace App\Requests\Api\Users;

use Illuminate\Foundation\Http\FormRequest;

/**
 * 新增字段校验
 * Class UpdateRequest
 * @package App\Requests\Api\Users
 */
class UpdateRequest extends FormRequest {
    public function authorize()
    {
        return true;
    }

    public function rules()
    {
        return [
            'username'    => 'required|string',
            'school_id'   => 'required|integer',
            'telephone'   => 'required|integer',
        ];
    }

    public function messages()
    {
        return [
            'username.string'    => '关键字必须是字符串',
            'username.max'       => '关键字长度过大',
            'telephone.integer'  => '手机号必须数字',
            'school_id.integer'  => '校区ID必须是整数',
        ];
    }
}